import Cookies from 'js-cookie'

/**
 * 是否登录
 * @param -
 * @returns {boolean}
 */
function isLogin() {
    return !!Cookies.get('account')
}

/**
 * 存储
 * @param -
 * @returns {fun}
 */
function setCookie(key, val) {
    Cookies.set([key], val)
}

/**
 * 获取
 * @param -
 * @returns {fun}
 */
function getCookie(key) {
    return Cookies.get([key])
}

/**
 * 清空所有
 * @param -
 * @returns {fun}
 */
function removeCookie() {
    Cookies.remove()
}

export default {
    isLogin,
    setCookie,
    getCookie,
    removeCookie,
}